package design.proxy.base;

import design.builder.base.Product;

/**
 * \* User: Administrator
 * <p>
 * \* Date: 2020/9/21
 * <p>
 * \* Time: 16:32
 * <p>
 * \* Description:
 * \
 */
public class Proxy implements Subject{

    private Subject subject = null;

    public Proxy() {
        this.subject = new Proxy();
    }

    public Proxy(Subject subject) {
        this.subject = subject;
    }

    @Override
    public void request() {
        this.before();
        this.subject.request();
        this.after();
    }

    private void before() {
        System.out.println("before");
    }
    private void after() {
        System.out.println("after");
    }
}
